#region License
// /* **************************************************************
// * Copyright (C) intex Consulting GmbH - All Rights Reserved    *
// *--------------------------------------------------------------*
// * Unauthorized copying of this file, via any medium is         *
// * strictly prohibited                                          *
// *--------------------------------------------------------------*
// * Proprietary and confidential                                 *
// *--------------------------------------------------------------*
// * Dissasembling/modifications strictly prohibited!             *
// ***************************************************************/
#endregion

using System;
using System.Diagnostics.CodeAnalysis;

namespace ComHlp.ContentClasses.VirtualControls.Buttons
{
    [SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Global")]
    public class ItxButtonAction : ICloneable
    {
        /// <summary> field button belongs to </summary>
        public string Field { get; set; }

        /// <summary> button value </summary>
        public string Value { get; set; }

        /// <summary> what to do </summary>
        public EItxButtonAction Action { get; set; }

        public bool SubmitMap { get; set; }

        public ItxButtonAction(string field, string value, EItxButtonAction action)
        {
            Field = field;
            Value = value;
            Action = action;
            switch (action)
            {
                case EItxButtonAction.KeyReturn:
                case EItxButtonAction.Plus:
                case EItxButtonAction.Minus:
                case EItxButtonAction.PerformHelp:
                    SubmitMap = true;
                    break;
            }
        }

        object ICloneable.Clone() { return Clone(); }
        // ReSharper disable once MemberCanBePrivate.Global
        public ItxButtonAction Clone()
        {
            ItxButtonAction buttonAction = MemberwiseClone() as ItxButtonAction;
            return buttonAction;
        }
    }
}